from Base import message, intersect, SS_VALID
from DRG import MDCQ_DRG

def group(record):
  adrg_zd = ["D61.800x002","D61.905"]
  adrg_zd1 = []
  adrg_ss = []
  adrg_ss1 = []
  dept_list = []

  if True and record.zdList[0] in adrg_zd and (not record.ssList or not intersect(record.ssList[0],SS_VALID)):
    message('符合QS3入组条件，匹配规则：主诊断匹配')

    if MDCQ_DRG.QS31_group(record):
      return 'QS31'

    if MDCQ_DRG.QS33_group(record):
      return 'QS33'

    if MDCQ_DRG.QS35_group(record):
      return 'QS35'
        
    return 'QS3'
  else:
    return ''
    
